package com.zut.Service.problemImpl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zut.Annotations.cache;
import com.zut.Pojo.Result;
import com.zut.Pojo.problem.Tag;
import com.zut.Service.problemTag;
import com.zut.dao.ProblemTagDao;
import com.zut.dao.TagDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service(value = "problemTagImpl")
public class problemTagImpl extends problemTag {

    @Autowired
    private ProblemTagDao problemTagDao;

    @Autowired
    private TagDao tagDao;

    @Override
    @cache(nameSpace = "tag",key="all")
    public Result GetTag() {

        try {
            List<Tag> tags = tagDao.selectList(null);
            return Result.builder().data(tags).build();
        } catch (Exception e) {
            // 异常处理逻辑
            return Result.builder().data("查询标签列表失败").build();
        }
    }
}
